package Mediator;

import Element.*;


public class SpecificMediator extends Mediator {
    public ActionButton getAddButton() {
        return addButton;
    }

    public void setAddButton(ActionButton addButton) {
        this.addButton = addButton;
    }

    public ItemList getItemList() {
        return itemList;
    }

    public void setItemList(ItemList itemList) {
        this.itemList = itemList;
    }

    public InputBox getUserInputBox() {
        return userInputBox;
    }

    public void setUserInputBox(InputBox userInputBox) {
        this.userInputBox = userInputBox;
    }

    public Dropdown getDropdown() {
        return dropdown;
    }

    public void setDropdown(Dropdown dropdown) {
        this.dropdown = dropdown;
    }
    //定义四个get和set方法
    private ActionButton addButton;
    private ItemList itemList;
    private InputBox userInputBox;
    private Dropdown dropdown;
//四个私有对象，只有创建特殊中介时候才可以使用
    @Override
    public void elementModified(Element e) {
        addButton.refresh();
        itemList.refresh();
        itemList.pick();
        userInputBox.refresh();
        userInputBox.setContent();
        dropdown.refresh();
        dropdown.pick();
    }
    //当调用这个方法的时候，会执行element中所有对象的具体方法
}